#include <string>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include "hashtbl.h"
#include "EncodedStructs.h"


int main()
{
     
        HashTbl *tbl;

        class numbers
        {
                public:
                        double flo;
        };

        numbers *p;


        if(!(tbl=new HashTbl(16, NULL))) {
                fprintf(stderr, "ERROR: hashtbl_create() failed\n");
                exit(EXIT_FAILURE);
        }


        double flo =0;
        tbl->insert("$f0", &flo);
        p=(numbers *)tbl->get("$f0");
        if(!p) printf("No match\n");
        else printf("$f0: %f \n", p->flo);


        flo++;
        tbl->insert("$f1", &flo);
        p=(numbers *)tbl->get("$f1");
        if(!p) printf("No match\n");
        else printf("$f1: %f \n", p->flo); 


	flo++;
        tbl->insert("$f2", &flo);
        p=(numbers *)tbl->get("$f2");
        if(!p) printf("No match\n");
        else printf("$f2: %f \n", p->flo); 


	flo++;
        tbl->insert("$f3", &flo);
        p=(numbers *)tbl->get("$f3");
        if(!p) printf("No match\n");
        else printf("$f3: %f \n", p->flo); 


	flo++;
        tbl->insert("$f4", &flo);
        p=(numbers *)tbl->get("$f4");
        if(!p) printf("No match\n");
        else printf("$f4: %f \n", p->flo); 

        flo++;
        tbl->insert("$f5", &flo);  
        p=(numbers *)tbl->get("$f5");  
        if(!p) printf("No match\n");   
        else printf("$f5: %f \n", p->flo); 

        flo++;
        tbl->insert("$f6", &flo);
        p=(numbers *)tbl->get("$f6");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f7", &flo);
        p=(numbers *)tbl->get("$f7");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f8", &flo);
        p=(numbers *)tbl->get("$f8");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f9", &flo);
        p=(numbers *)tbl->get("$f9");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f10", &flo);
        p=(numbers *)tbl->get("$f10");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f11", &flo);
        p=(numbers *)tbl->get("$f11");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f12", &flo);
        p=(numbers *)tbl->get("$f12");
        if(!p) printf("No match\n"); 
	printf("$f12: %f\n", p->flo);

        flo++;
        tbl->insert("$f13", &flo);
        p=(numbers *)tbl->get("$f13");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f14", &flo);
        p=(numbers *)tbl->get("$f14");
        if(!p) printf("No match\n");

	flo++;
        tbl->insert("$f15", &flo);
        p=(numbers *)tbl->get("$f15");
        if(!p) printf("No match\n"); 
 
        flo++;
        tbl->insert("$f16", &flo);
        p=(numbers *)tbl->get("$f16");
        if(!p) printf("No match\n"); 	

        flo++;
        tbl->insert("$f17", &flo);
        p=(numbers *)tbl->get("$f17");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f18", &flo);
        p=(numbers *)tbl->get("$f18");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f19", &flo);
        p=(numbers *)tbl->get("$f19");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f20", &flo);
        p=(numbers *)tbl->get("$f20");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f21", &flo);
        p=(numbers *)tbl->get("$f21");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f22", &flo);   
        p=(numbers *)tbl->get("$f22");
        if(!p) printf("No match\n");	

        flo++;
        tbl->insert("$f23", &flo);
        p=(numbers *)tbl->get("$f23");
        if(!p) printf("No match\n");

	flo++;
        tbl->insert("$f24", &flo);
        p=(numbers *)tbl->get("$f24");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f25", &flo);
        p=(numbers *)tbl->get("$f25");
        if(!p) printf("No match\n");  

        flo++;
        tbl->insert("$f26", &flo);
        p=(numbers *)tbl->get("$f26");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f27", &flo);
        p=(numbers *)tbl->get("$f27");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f28", &flo);
        p=(numbers *)tbl->get("$f28");
        if(!p) printf("No match\n"); 
	printf("$f28: %f\n", p->flo);	

        flo++;
        tbl->insert("$f29", &flo);
        p=(numbers *)tbl->get("$f29");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f30", &flo);
        p=(numbers *)tbl->get("$f30");
        if(!p) printf("No match\n"); 

        flo++;
        tbl->insert("$f31", &flo);
        p=(numbers *)tbl->get("$f31");
        if(!p) printf("No match\n"); 

        delete(tbl);
        return 0;
}
